RELEASED TO THE PUBLIC DOMAIN BY CODEWORKS DEVELOPMENT, DECEMBER 1993.
You may freely copy, distribute and reuse the code in this example. Codeworks disclaims any warranty of any kind, expressed or implied, as to its fitness for any particular use.
Info: Implementation of the Doodle class. Doodle is a subclass of View for creating arbitrary silly drawings. Doodle implements the basic behavior of setting foreground an background colors and loading a nib with custom controls. Subclasses, which are loaded from dynamic modules, provide the specific drawing functionality.
Info: Provides access to customControlView instance variable. This is a View that contains any special controls that a Doodle might need to adjust its appearance. Doodle expects this outlet to be connected to a View in a nib inside the module package. The nib should have the same name as the class--for instance the Star class uses Star.nib. This nib will be loaded when the customControlView is needed.
Info: Loads Doodle's nib with Doodle as owner. This lets the Doodle connect its customControlView outlet to a View in the nib. Subclasses should provide their own version of a nib in the module package. The nib should have the same name as the class--for instance the Star class uses Star.nib.
Info: Notifies Doodle that nib has been loaded. This gives subclasses a chance to perform any additional initialization that is dependent on the nib. (This cannot be done with awakeFromNib, because the Doodle is not in the nib, it is the nib's owner!) Typically, Doodle subclasses will use didLoadNib to set instance variables to the default settings of controls in the nib.
Info: Basic View drawing method. Just as a developement aid, Doodle fills its bounds with its backgroundColor. Subclasses should override this with their own desired drawing code.